package com.qn.visitor.service;

import com.qn.common.base.BaseServiceImpl;
import com.qn.core.exception.QnDelimitException;
import com.qn.visitor.entity.VisitorEventRecord;
import com.qn.visitor.mapper.VisitorEventRecordMapper;
import com.qn.visitor.write.WriteContext;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
/**
 * qingniu-cloud user source analysis
 *
 * @Author: TXG
 * @Date: 2024/6/11
 * @Version V0.0.2
 */
@DubboService(version = "1.0.0")
public class VisitorEventRecordServiceImpl
        extends BaseServiceImpl<VisitorEventRecord>
        implements VisitorEventRecordService {
    @Autowired
    WriteContext writeContext;
    @Override
    public void add(VisitorEventRecord record) throws QnDelimitException {
        record.setNewTime(new Date());
        writeContext.getVisitorEventWriteInstanc().add(record);
    }
}
